(function(){
  let docEl = document.documentElement

  function setRemUnit(){
      let rem = document.clientWidth / 10
      docEl.style.fontSize = rem + 'px'
  }

  setRemUnit()

  window.addEventListener('resize', setRemUnit())
})()